package Homework;

import java.io.File;
import java.util.Arrays;

public class RemoveFolder {

	public static void main(String[] args) {
		String src = "e://sai2";
		removeAll(src);
	}

	private static void removeAll(String src) {
		File dir = new File(src);
		File[] listFiles = dir.listFiles();
		Arrays.stream(listFiles).filter(File::isDirectory).forEach(f->removeAll(f.getAbsolutePath()));
		Arrays.stream(listFiles).forEach(File::delete);
	}

}
